package homework.work13;

public class Account {
    private String name;
    private String password;
    private double balance=100;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        if(name.length()>6||name.length()<4){
            System.out.println("Illegal name input");
            return;
        }
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        if(password.length()!=6){
            System.out.println("Illegal password input");
            return;
        }
        this.password = password;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        if(balance>100){
            this.balance = balance;
        }else{
            return;
        }

    }

    //构造器
    public Account() {
    }

    public Account(String name, String password, double balance) {
        this.name = name;
        this.password = password;
        this.balance = balance;
    }
}
